/* 1. 基础 reset */
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
background: #f5f7fa;
color: #333;
line-height: 1.6;
}
/* 2. 大标题 */
h1 {
text-align: center;
margin: 30px 0 10px;
font-size: 2.2rem;
color: #2c3e50;
}
/* 3. 表单区域 */
h2 {
margin: 20px 0 10px;
color: #34495e;
}
form {
background: #fff;
max-width: 600px;
margin: 0 auto 30px;
padding: 25px 30px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
form input[type="text"],
form textarea {
width: 100%;
padding: 10px 12px;
margin: 8px 0 15px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 1rem;
resize: vertical;
}
form input[type="submit"] {
background: #409eff;
color: #fff;
border: none;
padding: 10px 22px;
font-size: 1rem;
border-radius: 4px;
cursor: pointer;
transition: background 0.3s;
}
form input[type="submit"]:hover {
background: #66b1ff;
}
/* 4. 历史留言表格改造成卡片 */
table {
width: 90%;
max-width: 1000px;
margin: 0 auto 40px;
border-collapse: collapse;
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
th, td {
padding: 14px 16px;
text-align: left;
}
thead {
background: #eef2f6;
color: #606266;
font-weight: 600;
}
tbody tr:nth-child(even) {
background: #fafbfc;
}
tbody tr:hover {
background: #f0f9ff;
}
/* 5. 响应式：窄屏时表格左右滑动 */ @media (max-width: 600px) { table { display: block; overflow-x: auto; white-space: nowrap; } }